home *** CD-ROM | disk | FTP | other *** search
/ ftp.cs.arizona.edu / ftp.cs.arizona.edu.tar / ftp.cs.arizona.edu / icon / newsgrp / group03a.txt / 000040_icon-group-sender_Fri Mar 21 08:29:17 2003.msg < prev    next >
Internet Message Format  |  2003-12-22  |  1KB

  1. Return-Path: <icon-group-sender>
  2. Received: (from root@localhost)
  3.     by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id h2LFSPk21303
  4.     for icon-group-addresses; Fri, 21 Mar 2003 08:28:25 -0700 (MST)
  5. Message-Id: <200303211528.h2LFSPk21303@baskerville.CS.Arizona.EDU>
  6. Date: Thu, 20 Mar 2003 19:29:15 -0500
  7. From: "Steve Graham" <Steve_Graham@labcorp.com>
  8. To: <icon-group@cs.arizona.edu>
  9. Subject: Sockets in Icon/Unicon
  10. Content-Disposition: inline
  11. X-MIME-Autoconverted: from quoted-printable to 8bit by baskerville.CS.Arizona.EDU id h2L0TqD29410
  12. Errors-To: icon-group-errors@cs.arizona.edu
  13. Status: RO
  14.  
  15. I have a server program written in Unicon and a client one.  While the server does not abort (not sure if it works yet), the client aborts because it cannot open the port.  Can't figure out why.
  16.  
  17. Both are running on an Intel/Win98 box.  The programs are reproduced below.
  18.  
  19. Any help would be appreciated.
  20.  
  21.  
  22. Steve
  23.  
  24. ===
  25.  
  26. Client:
  27. procedure main()
  28. f := open(":1026","n") | stop("Unable to open port 1026")
  29. every write(f,1 to 4,"\n")
  30. close(f)
  31. end
  32.  
  33. Server:
  34. procedure main()
  35.    port := 1026
  36.    write("Server Test")
  37.    while net := open(":" || port,"na") do write(read(net))
  38.    close(net)
  39.    (&errno = 0) | stop("Error: ",&errortext)
  40. end
  41.  
  42.  
  43.  
  44.